<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <link rel="stylesheet" type="text/css" href="styles/css/bootstrap.min.css" />
    
    <title>My JSP 'index.jsp' starting page</title>
	
  </head>
  
  <body style="background-image:url(styles/img/bg2.jpg)">
   <div class="container" style="margin-top:100px" >

		

		<form action="pms.jspx?m=login" method="post" class="well" id="myform" style="width:220px;margin:0px auto;">

		  <legend>Kaishengit-PMS</legend>

		  <label>账号</label>

		  	<input type="text" class="span3"  name="name" id="userName" style="height:30px"><br />
			<span id="span1" style="color:red;"></span> <br />

		  <label>密码</label>

		 	 <input type="password" class="span3" name="password"  id="password" style="height:30px"><br />
			 <span id="span2" style="color:red;"></span> <br />

		  <br/>

		  <button type="button" id="btnSubmit" class="btn btn-primary">进入系统</button>

		</form>

		

	</div>

	
	<script type="text/javascript" src="styles/jquery/jquery.js"></script>
	<script type="text/javascript">
		$(document).ready(function(){
			$("#btnSubmit").click(function(){
				var userName = $("#userName").val();
				if(userName.trim().length == 0){
					$("#span1").html("账号不能为空！");
					$("#userName").focus();
					return;
				} else if(userName.length > 10){
					$("#span1").html("账号长度不能大于10");
					$("#userName").focus();
					return;										
				}
				
				
				
				
				var password = $("#password").val();
				if(password.trim().length == 0){
					$("#span2").html("密码不能为空！");
					$("#password").focus();
					return;
				} else if(password.length > 10){
					$("#span2").html("密码长度不能大于10！");
					$("password").focus();
					return;
				}
				
				
				
				$("#myform").submit();
			});
		});
	</script>
  </body>
</html>
